<template>
	<view class="container">
		<view class="accounteBox" v-for="(item, index) in userList" :key="index" @click="goRoute(index)">
			<view class="accountLeft">
				<view class="textBox">
					<view class="textTop">
						{{ item.label }}
					</view>
				</view>
			</view>
			<view class="accountRight">
				<image v-if="index == 0" src="../../static/icon/right.png"></image>
				<text>{{ item.value }}</text>
			</view>
		</view>
		<view class="outBox" @click="logoutEvent">
			退出登录
		</view>
	</view>
</template>
<script setup>
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app";
	import {
		ref,
		reactive
	} from "vue";
	import {
		useStore
	} from "@/store";
	let userList = ref([{
			label: "修改密码",
			value: ''
		},
		{
			label: "系统版本",
			value: 'V1.1.0'
		}
	]);
	let goRoute = (val) => {
		if (val === 0) {
			uni.navigateTo({
				url: "/pagesLogin/editPassword/index",
			});

		}
	};
	// 退出登录
	let logoutEvent = () => {
		// useStore()
		// 	.logout()
		// 	.then(() => {
		// 		uni.reLaunch({
		// 			url: "/pages/login/index"
		// 		});
		// 	});

		uni.removeStorageSync('phone');
		uni.removeStorageSync('pass');

		uni.reLaunch({
			url: "/pages/login/index"
		});
	}
</script>
<style lang="scss" scoped>
	@import "./index.scss";
</style>
<style>
	page {
		/* background-color: #FFF; */
	}
</style>